﻿{extend name="layout/base" /}

{block name="meta"}
{__block__}
<link rel="stylesheet" type="text/css" href="__ADDON__/__STYLE__/css/owl.carousel.css">
<link rel="stylesheet" type="text/css" href="__ADDON__/__STYLE__/css/owl.theme.css">
<link rel="stylesheet" type="text/css" href="__ADDON__/__STYLE__/css/owl.transitions.css">
{/block}

{block name="newsletter-popup"}
<!--Newsletter Popup Start-->
{if !empty($addonsTip)}
<div class="modal fade" id="addonsTipModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Clost">×</button>
                <h4>插件安装提醒:</h4>
            </div>
            <div class="modal-body">
                {volist name="addonsTip" id="vo"}
                <p>{$vo}</p>
                {/volist}
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">朕知道了</button>
            </div>
        </div>
    </div>
</div>
{/if}
<!--End of Newsletter Popup-->
{/block}

{block name="main"}
<!-- 轮播广告 -->
<div class="slider">
    <div class="tp-banner-container clearfix">
        <div class="tp-banner">
            <ul>
                {mall:ads code="ads-index" cache='86400'}
                <li data-transition="slidehorizontal" data-slotamount="5" data-masterspeed="700">
                    <img src="__MALLCDN__{$vo.adfile}" alt="{$vo.adname}" data-bgfit="cover"
                         data-bgposition="center center" data-bgrepeat="no-repeat">
                    {$vo.content}
                </li>
                {/mall:ads}
            </ul>
        </div>
    </div>
</div>
<!-- 广告墙 -->
<div class="top-banner">
    <div class="container">
        <div class="row">
            <div class="col-sm-6">
                {mall:ads code="wall-left-top" num='1' cache='86400' id="aw"}
                <div class="jtv-banner1">
                    <a {if ($aw['isOpen'])}target='_blank'{/if} {if
                    ($aw['adurl']!='')}onclick="MALL.recordClick({$aw['id']})"{/if} href="{$aw.adurl}"
                    onfocus="this.blur()" class="ads_wall_item_top">
                    <img src="__MALLCDN__{$aw.adfile}" alt="{$aw.adname}">
                    </a>
                    <div class="hover_content">
                        <div class="hover_data">
                            <div class="title"> {$aw.subtitle}</div>
                            <div class="desc-text"> {$aw.content}</div>
                            <div class="shop-now"><a {if ($aw['isOpen'])}target='_blank'{/if} {if
                                ($aw['adurl']!='')}onclick="MALL.recordClick({$aw['id']})"{/if} href="{$aw.adurl}"
                                onfocus="this.blur()" class="ads_wall_item_top">{:__("Shop now")}</a></div>
                        </div>
                    </div>

                </div>
                {/mall:ads}
                {mall:ads code="wall-left-bottom" num='1' cache='86400' id="aw"}
                <div class="jtv-banner2">
                    <a {if ($aw['isOpen'])}target='_blank'{/if} {if
                    ($aw['adurl']!='')}onclick="MALL.recordClick({$aw['id']})"{/if} href="{$aw.adurl}"
                    onfocus="this.blur()">
                    <img src="__MALLCDN__{$aw.adfile}" alt="">
                    </a>
                    <div class="hover_content">
                        <div class="hover_data">
                            <div class="title"> {$aw.subtitle}</div>
                            <div class="desc-text"> {$aw.content}</div>
                        </div>
                    </div>
                </div>
                {/mall:ads}
            </div>
            <div class="col-sm-6">
                {mall:ads code="wall-center" num='1' cache='86400' id="aw"}
                <div class="jtv-banner3">
                    <div class="jtv-banner3-inner">
                        <a {if ($aw['isOpen'])}target='_blank'{/if} {if
                        ($aw['adurl']!='')}onclick="MALL.recordClick({$aw['id']})"{/if} href="{$aw.adurl}"
                        onfocus="this.blur()">
                        <img src="__MALLCDN__{$aw.adfile}" alt="">
                        </a>
                        <div class="hover_content">
                            <div class="hover_data">
                                <div class="title"> {$aw.subtitle}</div>
                                <div class="desc-text"> {$aw.content}</div>
                            </div>
                        </div>
                    </div>
                </div>
                {/mall:ads}
            </div>
        </div>
    </div>
</div>

<!-- 特色商品 -->
<div class="main-container col1-layout">
    <div class="container">
        <div class="row">
            <!-- Home Tabs  -->
            <div class="col-sm-8 col-md-9 col-xs-12">
                <div class="home-tab">
                    <ul class="nav home-nav-tabs home-product-tabs">
                        <li class="active"><a href="#featured" data-toggle="tab" aria-expanded="false">推荐</a></li>
                        <li class="divider"></li>
                        <li><a href="#top-sellers" data-toggle="tab" aria-expanded="false">热销</a></li>
                    </ul>
                    <div id="productTabContent" class="tab-content">
                        <div class="tab-pane active in" id="featured">
                            <div class="featured-pro">
                                <div class="slider-items-products">
                                    <div id="featured-slider" class="product-flexslider hidden-buttons">
                                        <div class="slider-items slider-width-col4">
                                            {mall:goods type='recom'cache="86400" num='6' id='vo'}
                                            {include file="layout/item"}
                                            {/mall:goods}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="top-sellers">
                            <div class="top-sellers-pro">
                                <div class="slider-items-products">
                                    <div id="top-sellers-slider" class="product-flexslider hidden-buttons">
                                        <div class="slider-items slider-width-col4 ">
                                            {mall:goods type='hot'cache="86400" num='6' id='cs'}
                                            {include file="layout/item"}
                                            {/mall:goods}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--Hot deal -->
            <div class="col-md-3 col-sm-4 col-xs-12 hot-products">
                <div class="hot-deal"><span class="title-text">新品</span>
                    <ul class="products-grid">
                        {mall:goods type='new'cache="86400" num='1' id='cs'}
                        <li class="item">
                            <div class="product-item">
                                <div class="item-inner">
                                    <div class="product-thumbnail">
                                        {if $cs['hotis']}
                                        <div class="icon-hot-label hot-right">{:__("Hot")}</div>
                                        {/if}
                                        <div class="pr-img-area">
                                            <a title="{$cs['goodsname']}"
                                               href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">
                                                <figure>
                                                    <img class="first-img" src="{$cs['goodsimg']}" alt="">
                                                    <img class="hover-img" src="{$cs['goodsimg']}" alt="">
                                                </figure>
                                            </a>
                                            <button type="button" class="add-to-cart-mt"
                                                    onclick="javascript:addCart({$cs['id']});"><i
                                                    class="fa fa-shopping-cart"></i><span> {:__("Add to Cart")}</span>
                                            </button>
                                        </div>
                                        <div class="jtv-box-timer">
                                            <div class="countbox_1 jtv-timer-grid"></div>
                                        </div>
                                        <div class="pr-info-area">
                                            <div class="pr-button">
                                                <div class="mt-button add_to_wishlist">
                                                    {if $user && isset($cs['favGood']) && $cs['favGood']>0}
                                                    <a href='javascript:void(0);' title="{:__('Favourited')}"
                                                       onclick='cancelFavorite(this,"goods",{$cs["id"]},{$cs['favGood']})'><i
                                                        class="fa fa-heart"></i><span></span></a>
                                                    {else}
                                                    <a href='javascript:void(0);' title="{:__('Favourite')}"
                                                       onclick='addFavorite(this,"goods",{$cs["id"]})'><i
                                                            class="fa fa-heart-o"></i><span></span></a>
                                                    {/if}
                                                </div>
                                                <div class="mt-button add_to_compare"><a href="javascript:void(0);"
                                                                                         title="{:__('Compare')}"
                                                                                         onclick="javascript:contrastGoods(1,{$cs['id']},1)">
                                                    <i class="fa fa-signal"></i> </a></div>
                                                <div class="mt-button quick-view"><a
                                                        href="{:addon_url('mall/goods/Quickview','ids='.$cs['id'])}"
                                                        title="{:__('Quickview')}"> <i class="fa fa-search"></i> </a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="item-info">
                                        <div class="info-inner">
                                            <div class="item-title"><a title="{$cs['goodsname']}"
                                                                       href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">{:mb_substr($cs['goodsname'],0,16)} </a>
                                            </div>
                                            <div class="item-content">
                                                <div class="rating">
                                                    {for start="1" end="6"}
                                                    {if($i<=$cs['raty']['totalraty5'])}
                                                    <i class="fa fa-star"></i>
                                                    {else/}
                                                    <i class="fa fa-star-o"></i>
                                                    {/if}
                                                    {/for}
                                                </div>
                                                <div class="item-price">
                                                    <div class="price-box"><span class="regular-price"> <span
                                                            class="price">￥{$cs['shopprice']}</span> </span></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                        {/mall:goods}
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 通栏三列广告 -->
<div class="banner-static">
    <div class="container">
        <div class="row">
            {mall:ads code="index-col3" num='3' cache='86400' id="aw"}
            <div class="col-sm-4 col-sms-12">
                <div class="banner-box banner-box2">
                    <a {if ($aw['isOpen'])}target='_blank'{/if} {if
                    ($aw['adurl']!='')}onclick="MALL.recordClick({$aw['id']})"{/if} href="{$aw.adurl}"
                    onfocus="this.blur()">
                    <img src="__MALLCDN__{$aw.adfile}" alt="">
                    </a>
                    <div class="box-hover">
                        <div class="banner-title">{$aw.subtitle}</div>
                        <span>{$aw.content}</span></div>
                </div>
            </div>
            {/mall:ads}
        </div>
    </div>
</div>
{php}
    $validate = [0,1,2,3,4,5,6,7,8,9];
    $newArr = [];
    foreach($floors as $_k=>$_v){
        // echo "$_k";
        if(in_array($_k,$validate)){
            // echo "-1<hr />";
            $newArr[] = $_v;
            $_newArr = [];// 两个分类
        }else{
            // echo "-2<hr />";
            $_newArr[] = $_v;
            if(count($_newArr)==2){
                $newArr[] = $_newArr;
            }
        }
    }
    $floors = $newArr;
    // dump(count($floors));die;
    $oneCatFloor = [1,2,3,4,5,6,7];
    $floorCount = 1;// 楼层数
{/php}

<!--楼层-->
<div class="container">
    {volist name="$floors" id="vo1" key="l" length="7"}
    {if(in_array($l,$oneCatFloor))}
    <div class="special-products">
        <div class="page-header">
            <h2>{$l}F: {$vo1['name']}</h2>
        </div>
        <div class="special-products-pro">
            <div class="slider-items-products">
                <div id="special-products-slider" class="product-flexslider hidden-buttons">
                    <div class="slider-items slider-width-col4">
                        {mall:goods type='recom' cat="vo1['id']" cache="86400" num='6' id='vo'}
                        {include file="layout/item"}
                        {/mall:goods}
                    </div>
                </div>
            </div>
        </div>
    </div>
    {php}++$floorCount;{/php}
    {/if}
    {/volist}
</div>

<!--店铺与品牌-->
<div class="container">
    <div class="row">
        <!--店铺-->
        <div class="col-md-6">
            <div class="testimonials">
                <div class="slider-items-products">
                    <div id="testimonials-slider" class="product-flexslider hidden-buttons home-testimonials">
                        <div class="slider-items slider-width-col6">
                            {volist name="shopStreet" id="st" length="4"}
                            <div class="holder">
                                <strong class="name">{$st.name}</strong>
                                <strong class="designation"></strong>
                                <div class="thumb"><img src="{$st.streetimg?$st.streetimg:$st.shopimg}"
                                                        alt="{$st.name}"></div>
                                <p>{$st.shopAddress}</p>
                                <a href="{:addon_url('mall/shop/detail',['ids'=>$st.id])}" target="_blank"
                                   class="ss_entry"><p>>>进入店铺</p></a>
                            </div>
                            {/volist}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--品牌-->
        <div class="col-md-6">
            <div class="our-clients">
                <div class="slider-items-products">
                    <div id="our-clients-slider" class="product-flexslider hidden-buttons">
                        <div class="slider-items slider-width-col6">
                            {mall:brand cat="0" num='4' id="brd"}
                            <div class="holder">
                                <a href="{:addon_url('mall/brand/index')}">
                                    <div class="thumb">
                                        <img src="__MALLCDN__{$brd.brandimg}" alt="{$brd.name}"
                                             style="width:242px;heigt:242px;">
                                    </div>
                                </a>
                            </div>
                            {/mall:brand}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Latest news start -->
<div class="container">
    <div id="latest-news" class="news">
        <div class="page-header">
            <h2>{:__("Latest news")}</h2>
        </div>
        <div class="slider-items-products">
            <div id="latest-news-slider" class="product-flexslider hidden-buttons">
                <div class="slider-items slider-width-col6">
                    {mall:article cat="new" num='5' cache='86400'}
                    <div class="item">
                        <div class="jtv-blog">
                            <div class="blog-img"><a href="{:addon_url('mall/help/detail',['id'=>$vo['id']])}"> <img
                                    class="primary-img" src="__MALLCDN__{$vo['coverimg']}" alt=""></a> <span
                                    class="moretag"></span></div>
                            <div class="blog-content-jtv">
                                <h2>
                                    <a href="{:addon_url('mall/help/detail',['id'=>$vo['id']])}">{$vo['articleTitle']}</a>
                                </h2>
                                <span class="blog-likes"><i class="fa fa-heart"></i>{$vo['likeNum']}</span> <span
                                    class="blog-comments"><i class="fa fa-comment"></i>{$vo['visitorNum']}</span>
                                <div class="blog-action"><span>{$vo['updatetime']|date='Y-m-d',###}</span> <a
                                        class="read-more"
                                        href="{:addon_url('mall/help/index',['cat_id'=>$vo['cat_id']])}">{:__("More")}</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    {/mall:article}
                </div>
            </div>
        </div>
    </div>
</div>

<!-- service section -->
<div class="jtv-service-area">
    <div class="container">
        <div class="row">
            <div class="col col-md-3 col-sm-6 col-xs-12">
                <div class="block-wrapper ship">
                    <div class="text-des">
                        <div class="icon-wrapper"><i class="fa fa-truck"></i></div>
                        <div class="service-wrapper">
                            <h3>免费配送</h3>
                            <p>满￥99元包邮</p></div>
                    </div>
                </div>
            </div>
            <div class="col col-md-3 col-sm-6 col-xs-12 ">
                <div class="block-wrapper return">
                    <div class="text-des">
                        <div class="icon-wrapper"><i class="fa fa-refresh"></i></div>
                        <div class="service-wrapper">
                            <h3>退货无忧</h3>
                            <p>七天退货保障</p></div>
                    </div>
                </div>
            </div>
            <div class="col col-md-3 col-sm-6 col-xs-12">
                <div class="block-wrapper support">
                    <div class="text-des">
                        <div class="icon-wrapper"><i class="fa fa-umbrella"></i></div>
                        <div class="service-wrapper">
                            <h3>正品保证</h3>
                            <p>100%原产地</p></div>
                    </div>
                </div>
            </div>
            <div class="col col-md-3 col-sm-6 col-xs-12">
                <div class="block-wrapper user">
                    <div class="text-des">
                        <div class="icon-wrapper"><i class="fa fa-cny"></i></div>
                        <div class="service-wrapper">
                            <h3>货到付款</h3>
                            <p>400城市送货上门</p></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- category area start -->
<div class="jtv-category-area">
    <div class="container">
        <div class="row">
            <div class="col-md-4 col-sm-6">
                <div class="jtv-single-cat">
                    <h2 class="cat-title">猜您喜欢</h2>
                    {mall:goods type='guess' cat="0" cache="86400" num='3' id='cs'}
                    <div class="jtv-product {if $i>1}jtv-cat-margin{/if}">
                        <div class="product-img">
                            <a href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">
                                <img src="{$cs['goodsimg']}" alt="">
                                <img class="secondary-img" src="{:$cs['goodsimg']}" alt="">
                            </a>
                        </div>
                        <div class="jtv-product-content">
                            <h3><a href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">{:mb_substr($cs['goodsname'],0,12)}</a>
                            </h3>
                            <div class="price-box"><span class="regular-price"> <span
                                    class="price">￥{$cs['shopprice']}</span> </span></div>
                            <div class="jtv-product-action">
                                <div class="jtv-extra-link">
                                    <div class="button-cart">
                                        <button onclick="javascript:addCart({$cs['id']});"><i
                                                class="fa fa-shopping-cart"></i></button>
                                    </div>
                                    <a hhref="{:addon_url('mall/goods/Quickview','ids='.$cs['id'])}" data-toggle="modal"
                                       data-target="#productModal"><i class="fa fa-search"></i></a>
                                    {if $user && isset($cs['favGood']) && $cs['favGood']>0}
                                    <a href='javascript:void(0);' title="{:__('Favourited')}"
                                       onclick='cancelFavorite(this,"goods",{$cs["id"]},{$cs['favGood']})'><i
                                        class="fa fa-heart"></i><span></span></a>
                                    {else}
                                    <a href='javascript:void(0);' title="{:__('Favourite')}"
                                       onclick='addFavorite(this,"goods",{$cs["id"]})'><i
                                            class="fa fa-heart-o"></i><span></span></a>
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                    {/mall:goods}
                </div>
            </div>
            <div class="col-md-4 col-sm-6">
                <div class="jtv-single-cat">
                    <h2 class="cat-title">评分最高</h2>
                    {mall:goods type='score' cat="0" cache="86400" num='3' id='cs'}
                    <div class="jtv-product {if $i>1}jtv-cat-margin{/if}">
                        <div class="product-img">
                            <a href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">
                                <img src="{$cs['goodsimg']}" alt="">
                                <img class="secondary-img" src="{$cs['goodsimg']}" alt="">
                            </a>
                        </div>
                        <div class="jtv-product-content">
                            <h3><a href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">{:mb_substr($cs['goodsname'],0,12)}</a>
                            </h3>
                            <div class="price-box"><span class="regular-price"> <span
                                    class="price">￥{$cs['shopprice']}</span> </span></div>
                            <div class="jtv-product-action">
                                <div class="jtv-extra-link">
                                    <div class="button-cart">
                                        <button onclick="javascript:addCart({$cs['id']});"><i
                                                class="fa fa-shopping-cart"></i></button>
                                    </div>
                                    <a hhref="{:addon_url('mall/goods/Quickview','ids='.$cs['id'])}" data-toggle="modal"
                                       data-target="#productModal"><i class="fa fa-search"></i></a>
                                    {if $user && isset($cs['favGood']) && $cs['favGood']>0}
                                    <a href='javascript:void(0);' title="{:__('Favourited')}"
                                       onclick='cancelFavorite(this,"goods",{$cs["id"]},{$cs['favGood']})'><i
                                        class="fa fa-heart"></i><span></span></a>
                                    {else}
                                    <a href='javascript:void(0);' title="{:__('Favourite')}"
                                       onclick='addFavorite(this,"goods",{$cs["id"]})'><i
                                            class="fa fa-heart-o"></i><span></span></a>
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                    {/mall:goods}
                </div>
            </div>
            <div class="col-md-4 col-sm-6">
                <div class="jtv-single-cat">
                    <h2 class="cat-title">关注最多</h2>
                    {mall:goods type='wish' cat="0" cache="86400" num='3' id='cs'}
                    <div class="jtv-product {if $i>1}jtv-cat-margin{/if}">
                        <div class="product-img">
                            <a href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">
                                <img src="{$cs['goodsimg']}" alt="">
                                <img class="secondary-img" src="{$cs['goodsimg']}" alt="">
                            </a>
                        </div>
                        <div class="jtv-product-content">
                            <h3><a href="{:addon_url('mall/goods/detail','ids='.$cs['id'])}">{:mb_substr($cs['goodsname'],0,12)}</a>
                            </h3>
                            <div class="price-box"><span class="regular-price"> <span
                                    class="price">￥{$cs['shopprice']}</span> </span></div>
                            <div class="jtv-product-action">
                                <div class="jtv-extra-link">
                                    <div class="button-cart">
                                        <button onclick="javascript:addCart({$cs['id']});"><i
                                                class="fa fa-shopping-cart"></i></button>
                                    </div>
                                    <a hhref="{:addon_url('mall/goods/Quickview','ids='.$cs['id'])}" data-toggle="modal"
                                       data-target="#productModal"><i class="fa fa-search"></i></a>
                                    {if $user && isset($cs['favGood']) && $cs['favGood']>0}
                                    <a href='javascript:void(0);' title="{:__('Favourited')}"
                                       onclick='cancelFavorite(this,"goods",{$cs["id"]},{$cs['favGood']})'><i
                                        class="fa fa-heart"></i><span></span></a>
                                    {else}
                                    <a href='javascript:void(0);' title="{:__('Favourite')}"
                                       onclick='addFavorite(this,"goods",{$cs["id"]})'><i
                                            class="fa fa-heart-o"></i><span></span></a>
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                    {/mall:goods}
                </div>
            </div>
        </div>
    </div>
</div>
<!-- category-area end -->

{/block}

{block name="js"}
{__block__}
<script type="text/javascript" src="__ADDON__/__STYLE__/js/owl.carousel.min.js"></script>
<script type="text/javascript" src="__ADDON__/__STYLE__/js/main.js"></script>

<!-- countdown js -->
<script type="text/javascript" src="__ADDON__/__STYLE__/js/countdown.js"></script>
<!-- Slider Js -->
<script type="text/javascript" src="__ADDON__/__STYLE__/js/revolution-slider.min.js"></script>

<!-- Revolution Slider -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        jQuery('.tp-banner').revolution(
            {
                delay: 9000,
                startwidth: 1920,
                startheight: 790,
                hideThumbs: 10,

                navigationType: "bullet",
                navigationStyle: "preview1",

                hideArrowsOnMobile: "on",

                touchenabled: "on",
                onHoverStop: "on",
                spinner: "spinner4"
            });
    });
</script>
<!-- Hot Deals Timer 1-->
<script type="text/javascript">
    var dthen1 = new Date("03/25/19 11:59:00 PM");
    start = "08/04/15 03:02:11 AM";
    start_date = Date.parse(start);
    var dnow1 = new Date(start_date);
    if (CountStepper > 0)
        ddiff = new Date((dnow1) - (dthen1));
    else
        ddiff = new Date((dthen1) - (dnow1));
    gsecs1 = Math.floor(ddiff.valueOf() / 1000);

    var iid1 = "countbox_1";
    CountBack_slider(gsecs1, "countbox_1", 1);

    if ($("#addonsTipModal").size() > 0) $('#addonsTipModal').modal();

</script>

{/block}